package com.grades.springboot.controller;

import com.grades.springboot.entity.Result;
import com.grades.springboot.service.CaptchaService;
import com.grades.springboot.service.impl.CaptchaServiceImpl;
import com.wf.captcha.GifCaptcha;
import com.wf.captcha.utils.CaptchaUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
public class CaptchaController {

    @Autowired
    private CaptchaServiceImpl captchaService;

    @RequestMapping("/captcha")
    public Result<?> getCaptcha(HttpServletRequest request, HttpServletResponse response) throws Exception {
        return captchaService.getCaptcha(request,response);
    }
}
